------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/luismiguelmillermoya/Dropbox/Papers/Active/CIS/Submission/PA/Final/submit/Script/BM_PA.log
  log type:  text
 opened on:  23 Nov 2020, 06:24:55

. 
. set seed 1

. clear

. set more off

. 
. use "Data/BM_PA.dta", clear

. set sortseed 1

. * Donut hole
. drop if z == 0
(204 observations deleted)

. 
. ************************************************************************************
. * Figure 1: Window selection: minimum p-value against window length
. ************************************************************************************
. 
. rdwinselect z female a30-a70 urban1 urban2 urban3, stat(hotelling) level(0.05) wstep(0.2) nwindows(13) plot graph_options(graphreg
> ion(color(white)) xtitle(Window length (at each side of the cutoff)) ysc(r(.4)) xlab(0.2(0.2)2.6) ytitle(P-value) yline(0.05, lcol
> or(black) lpattern(dash)) mcolor(black) ylab(, nogrid) note(The dotted line corresponds top-value=.05, pos(1)))


Window selection for RD under local randomization


Cutoff c = 0.00   | Left of c   Right of c        Number of obs  =         33631
------------------+-----------------------        Order of poly  =             0
    Number of obs |     29422         4209        Kernel type    =       uniform
   1st percentile |       417            0        Reps           =          1000
   5th percentile |      1601          127        Testing method =     rdrandinf
  10th percentile |      2959          277        Balance test   =     hotelling
  20th percentile |      6090          714


                  |   Bal. test         Var. name    Bin. test 
 Window length /2 |    p-value        (min p-value)   p-value     Obs<c   Obs>=c
------------------+-------------------------------------------------------------
            0.200 |      0.084                -         0.013       171      127
            0.400 |      0.342                -         1.000       277      277
            0.600 |      0.318                -         1.000       277      277
            0.800 |      0.158                -         0.881       559      553
            1.000 |      0.046                -         0.120       775      714
            1.200 |      0.033                -         0.120       775      714
            1.400 |      0.001                -         0.714       942      959
            1.600 |      0.001                -         0.714       942      959
            1.800 |      0.000                -         0.000       996     1234
            2.000 |      0.000                -         0.000      1072     1448
            2.200 |      0.000                -         0.000      1072     1448
            2.400 |      0.000                -         0.000      1123     1571
            2.600 |      0.000                -         0.000      1262     1832

Variable used in binomial test (running variable): z
Covariates used in balance test: female a30 a40 a50 a60 a70 urban1 urban2 urban3

Recommended window is [-.8; .8] with 1112 observations (559 below, 553 above).

. 
. graph export "Results/Figures/Figure 1.pdf", as(pdf) replace
(file /Users/luismiguelmillermoya/Dropbox/Papers/Active/CIS/Submission/PA/Final/submit/Results/Figures/Figure 1.pdf written in PDF f
> ormat)

. 
. ************************************************************************************
. * Figure 2: See BM_PA_Figure2.Rmd
. ************************************************************************************
. 
. 
. ************************************************************************************
. * Confidence Interval for the effect of treatment on page 5 (0.8 window)                                                        
. ************************************************************************************
.  
. rdrandinf ivotd z, seed(50) wl(-0.800001) wr(0.800001) ci(0.05)

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        551         545        Reps          =           1000
   Mean of outcome|      0.844       0.895        Window        =    set by user
   S.D. of outcome|      0.363       0.306        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.051       0.010          0.011                  1.000
--------------------------------------------------------------------------------
Calculating confidence interval...
Confidence interval obtained.

Confidence interval for w = .800001
------------------------------------------
         Statistic|   [95% Conf. Interval]
------------------+-----------------------
    Diff. in means|      0.020       0.090
------------------------------------------

. 
. 
. ************************************************************************************
. * Table A2: Sentitivity of the results to window choice                                                                           
>                       
. ************************************************************************************
. 
. use "Data/BM_PA.dta", clear

. 
. * Donut hole
. drop if z == 0
(204 observations deleted)

. 
. * Loop for getting results across the 13 windows
. 
. ** set up  window size macros 
. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 -2.000001 -2.200001 -2.400001 -2
> .600001

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. 
. local n : word count `X'

. 
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. rdrandinf ivotd z, seed(50) wl(`xi') wr(`yi')
  5. }

Selected window = [-.200001 ; .200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        169         127        Reps          =           1000
   Mean of outcome|      0.817       0.858        Window        =    set by user
   S.D. of outcome|      0.388       0.350        H0:       tau =          0.000
            Window|     -0.200       0.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.19
------------------+-------------------------------------------------------------
    Diff. in means|      0.042       0.338          0.333                  0.995
--------------------------------------------------------------------------------

Selected window = [-.400001 ; .400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        274         273        Reps          =           1000
   Mean of outcome|      0.858       0.897        Window        =    set by user
   S.D. of outcome|      0.350       0.304        H0:       tau =          0.000
            Window|     -0.400       0.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.040       0.191          0.156                  1.000
--------------------------------------------------------------------------------

Selected window = [-.600001 ; .600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        410         402        Reps          =           1000
   Mean of outcome|      0.849       0.898        Window        =    set by user
   S.D. of outcome|      0.359       0.303        H0:       tau =          0.000
            Window|     -0.600       0.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.049       0.035          0.035                  1.000
--------------------------------------------------------------------------------

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        551         545        Reps          =           1000
   Mean of outcome|      0.844       0.895        Window        =    set by user
   S.D. of outcome|      0.363       0.306        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.051       0.009          0.011                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.000001 ; 1.000001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        765         702        Reps          =           1000
   Mean of outcome|      0.847       0.889        Window        =    set by user
   S.D. of outcome|      0.360       0.314        H0:       tau =          0.000
            Window|     -1.000       1.000        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.042       0.023          0.018                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.200001 ; 1.200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        921         810        Reps          =           1000
   Mean of outcome|      0.847       0.893        Window        =    set by user
   S.D. of outcome|      0.360       0.310        H0:       tau =          0.000
            Window|     -1.200       1.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.046       0.003          0.005                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.400001 ; 1.400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        930         941        Reps          =           1000
   Mean of outcome|      0.846       0.887        Window        =    set by user
   S.D. of outcome|      0.361       0.316        H0:       tau =          0.000
            Window|     -1.400       1.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.041       0.007          0.009                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.600001 ; 1.600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        946        1055        Reps          =           1000
   Mean of outcome|      0.848       0.889        Window        =    set by user
   S.D. of outcome|      0.359       0.314        H0:       tau =          0.000
            Window|     -1.600       1.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.041       0.007          0.006                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.800001 ; 1.800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|        981        1213        Reps          =           1000
   Mean of outcome|      0.848       0.892        Window        =    set by user
   S.D. of outcome|      0.359       0.311        H0:       tau =          0.000
            Window|     -1.800       1.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.044       0.004          0.003                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.000001 ; 2.000001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|       1055        1425        Reps          =           1000
   Mean of outcome|      0.851       0.893        Window        =    set by user
   S.D. of outcome|      0.356       0.310        H0:       tau =          0.000
            Window|     -2.000       2.000        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.041       0.005          0.002                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.200001 ; 2.200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|       1106        1547        Reps          =           1000
   Mean of outcome|      0.854       0.893        Window        =    set by user
   S.D. of outcome|      0.353       0.310        H0:       tau =          0.000
            Window|     -2.200       2.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.038       0.003          0.004                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.400001 ; 2.400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|       1168        1688        Reps          =           1000
   Mean of outcome|      0.855       0.892        Window        =    set by user
   S.D. of outcome|      0.352       0.310        H0:       tau =          0.000
            Window|     -2.400       2.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.037       0.005          0.004                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.600001 ; 2.600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      29191        3855        Kernel type   =        uniform
Eff. Number of obs|       1244        1803        Reps          =           1000
   Mean of outcome|      0.855       0.889        Window        =    set by user
   S.D. of outcome|      0.353       0.315        H0:       tau =          0.000
            Window|     -2.600       2.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.034       0.004          0.006                  1.000
--------------------------------------------------------------------------------

. * 
. 
. * Export results from Table A2
. *-----------------------------------------------------------------------------------
. 
. putexcel set "Results/Tables/Table A2", modify

. 
. local Ys 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 -2.000001 -2.200001 -2.400001 -2
> .600001

. 
. local n : word count `Y'

. 
. matrix A = J(13,3,.)

. 
. forvalues i=1/`n' {
  2. local yis : word `i' of `Ys'
  3. matrix A[`i',1] = `yis'
  4. }

. *
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. quietly: sum ivotd if z >= `xi' & z <= 0
  5.         scalar meanc = r(mean)
  6.         quietly: sum ivotd if z >= 0 & z <= `yi'        
  7.         scalar meant = r(mean)
  8.         matrix A[`i',2] = meanc
  9.         matrix A[`i',3] = meant
 10. }

. *
. matrix list A, format(%4.3f)

A[13,3]
        c1     c2     c3
 r1  0.200  0.817  0.858
 r2  0.400  0.858  0.897
 r3  0.600  0.849  0.898
 r4  0.800  0.844  0.895
 r5  1.000  0.847  0.889
 r6  1.200  0.847  0.893
 r7  1.400  0.846  0.887
 r8  1.600  0.848  0.889
 r9  1.800  0.848  0.892
r10  2.000  0.851  0.893
r11  2.200  0.854  0.893
r12  2.400  0.855  0.892
r13  2.600  0.855  0.889

. putexcel C3=matrix(A)
file Results/Tables/Table A2.xlsx saved

. 
. matrix B = J(13,4,.)

. 
. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 -2.000001 -2.200001 -2.400001 -2
> .600001

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. 
. local n : word count `X'

. 
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. quietly: rdrandinf ivotd z, seed(50) wl(`xi') wr(`yi')
  5.     scalar diff = r(obs_stat)
  6.         scalar fpvalue = r(randpval)
  7.         scalar nleft = r(N_left)
  8.         scalar nright = r(N_right)
  9.         matrix B[`i',1] = diff
 10.         matrix B[`i',2] = fpvalue
 11.         matrix B[`i',3] = nleft
 12.         matrix B[`i',4] = nright
 13. }

. *
. matrix list B, format(%4.3f) 

B[13,4]
           c1        c2        c3        c4
 r1     0.042     0.338   169.000   127.000
 r2     0.040     0.191   274.000   273.000
 r3     0.049     0.035   410.000   402.000
 r4     0.051     0.009   551.000   545.000
 r5     0.042     0.023   765.000   702.000
 r6     0.046     0.003   921.000   810.000
 r7     0.041     0.007   930.000   941.000
 r8     0.041     0.007   946.000  1055.000
 r9     0.044     0.004   981.000  1213.000
r10     0.041     0.005  1055.000  1425.000
r11     0.038     0.003  1106.000  1547.000
r12     0.037     0.005  1168.000  1688.000
r13     0.034     0.004  1244.000  1803.000

. putexcel F3=matrix(B)
file Results/Tables/Table A2.xlsx saved

. 
. 
. ************************************************************************************
. * Table A3: Placebo test: 1st placebo week before Poll1’s publication                                                         
. ************************************************************************************
. 
. use "Data/BM_PA.dta", clear

. 
. gen  z_p = 0 if t_inc==33.2
(33,835 missing values generated)

. replace  z_p = t_inc - 33.2 if t<19 
(16,058 real changes made)

. replace  z_p = t_inc - 33.2 if t>20 
(17,489 real changes made)

.         
. replace z_p = round(z_p, .1)
(13,994 real changes made)

. 
. drop if z_p == 0
(262 observations deleted)

. 
. 
. * Loop for getting results across the 13 windows
. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 -2.000001 -2.200001 -2.400001 -2
> .600001

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. 
. local n : word count `X'

. 
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. rdrandinf ivotd z_p, seed(50) wl(`xi') wr(`yi')
  5. }

Selected window = [-.200001 ; .200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|        180         131        Reps          =           1000
   Mean of outcome|      0.894       0.931        Window        =    set by user
   S.D. of outcome|      0.308       0.254        H0:       tau =          0.000
            Window|     -0.200       0.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.15
------------------+-------------------------------------------------------------
    Diff. in means|      0.037       0.297          0.248                  0.998
--------------------------------------------------------------------------------

Selected window = [-.400001 ; .400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|        314         287        Reps          =           1000
   Mean of outcome|      0.898       0.906        Window        =    set by user
   S.D. of outcome|      0.303       0.292        H0:       tau =          0.000
            Window|     -0.400       0.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.15
------------------+-------------------------------------------------------------
    Diff. in means|      0.008       0.786          0.747                  1.000
--------------------------------------------------------------------------------

Selected window = [-.600001 ; .600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|        444         416        Reps          =           1000
   Mean of outcome|      0.890       0.892        Window        =    set by user
   S.D. of outcome|      0.314       0.311        H0:       tau =          0.000
            Window|     -0.600       0.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|      0.002       1.000          0.918                  1.000
--------------------------------------------------------------------------------

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|        596         609        Reps          =           1000
   Mean of outcome|      0.893       0.900        Window        =    set by user
   S.D. of outcome|      0.310       0.300        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.15
------------------+-------------------------------------------------------------
    Diff. in means|      0.007       0.678          0.682                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.000001 ; 1.000001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|        825         845        Reps          =           1000
   Mean of outcome|      0.898       0.897        Window        =    set by user
   S.D. of outcome|      0.303       0.304        H0:       tau =          0.000
            Window|     -1.000       1.000        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.15
------------------+-------------------------------------------------------------
    Diff. in means|     -0.001       1.000          0.939                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.200001 ; 1.200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|        958        1008        Reps          =           1000
   Mean of outcome|      0.891       0.892        Window        =    set by user
   S.D. of outcome|      0.311       0.311        H0:       tau =          0.000
            Window|     -1.200       1.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|      0.000       1.000          0.976                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.400001 ; 1.400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|        984        1173        Reps          =           1000
   Mean of outcome|      0.891       0.890        Window        =    set by user
   S.D. of outcome|      0.311       0.313        H0:       tau =          0.000
            Window|     -1.400       1.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|     -0.001       0.946          0.927                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.600001 ; 1.600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|       1012        1342        Reps          =           1000
   Mean of outcome|      0.889       0.885        Window        =    set by user
   S.D. of outcome|      0.314       0.319        H0:       tau =          0.000
            Window|     -1.600       1.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|     -0.004       0.804          0.756                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.800001 ; 1.800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|       1045        1560        Reps          =           1000
   Mean of outcome|      0.886       0.883        Window        =    set by user
   S.D. of outcome|      0.318       0.322        H0:       tau =          0.000
            Window|     -1.800       1.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|     -0.003       0.800          0.788                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.000001 ; 2.000001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|       1102        1854        Reps          =           1000
   Mean of outcome|      0.887       0.874        Window        =    set by user
   S.D. of outcome|      0.317       0.332        H0:       tau =          0.000
            Window|     -2.000       2.000        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|     -0.012       0.349          0.318                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.200001 ; 2.200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|       1150        2007        Reps          =           1000
   Mean of outcome|      0.884       0.873        Window        =    set by user
   S.D. of outcome|      0.320       0.333        H0:       tau =          0.000
            Window|     -2.200       2.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|     -0.011       0.353          0.342                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.400001 ; 2.400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|       1197        2194        Reps          =           1000
   Mean of outcome|      0.884       0.874        Window        =    set by user
   S.D. of outcome|      0.321       0.332        H0:       tau =          0.000
            Window|     -2.400       2.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|     -0.010       0.403          0.385                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.600001 ; 2.600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33573
------------------+-----------------------        Order of poly =              0
     Number of obs|      24014        8975        Kernel type   =        uniform
Eff. Number of obs|       1270        2364        Reps          =           1000
   Mean of outcome|      0.883       0.871        Window        =    set by user
   S.D. of outcome|      0.321       0.335        H0:       tau =          0.000
            Window|     -2.600       2.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|     -0.012       0.310          0.287                  1.000
--------------------------------------------------------------------------------

. *
. 
. * Export results from Table A3
. *-----------------------------------------------------------------------------------
. 
. putexcel set "Results/Tables/Table A3", modify

. 
. local Ys 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 -2.000001 -2.200001 -2.400001 -2
> .600001

. 
. local n : word count `Y'

. 
. matrix A = J(13,3,.)

. 
. forvalues i=1/`n' {
  2. local yis : word `i' of `Ys'
  3. 
. 
. matrix A[`i',1] = `yis'
  4. }

. *
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. quietly: sum ivotd if z_p >= `xi' & z_p <= 0
  5.         scalar meanc = r(mean)
  6.         quietly: sum ivotd if z_p >= 0 & z_p<= `yi'     
  7.         scalar meant = r(mean)
  8.         matrix A[`i',2] = meanc
  9.         matrix A[`i',3] = meant
 10. }

. *
. matrix list A, format(%4.3f)

A[13,3]
        c1     c2     c3
 r1  0.200  0.894  0.931
 r2  0.400  0.898  0.906
 r3  0.600  0.890  0.892
 r4  0.800  0.893  0.900
 r5  1.000  0.898  0.897
 r6  1.200  0.891  0.892
 r7  1.400  0.891  0.890
 r8  1.600  0.889  0.885
 r9  1.800  0.886  0.883
r10  2.000  0.887  0.874
r11  2.200  0.884  0.873
r12  2.400  0.884  0.874
r13  2.600  0.883  0.871

. putexcel C3=matrix(A)
file Results/Tables/Table A3.xlsx saved

. 
. 
. matrix B = J(13,4,.)

. 
. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 -2.000001 -2.200001 -2.400001 -2
> .600001

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. 
. local n : word count `X'

. 
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. quietly:  rdrandinf ivotd z_p, seed(50) wl(`xi') wr(`yi')
  5.     scalar diff = r(obs_stat)
  6.         scalar fpvalue = r(randpval)
  7.         scalar nleft = r(N_left)
  8.         scalar nright = r(N_right)
  9.         matrix B[`i',1] = diff
 10.         matrix B[`i',2] = fpvalue
 11.         matrix B[`i',3] = nleft
 12.         matrix B[`i',4] = nright
 13. }

. *
. matrix list B, format(%4.3f) 

B[13,4]
           c1        c2        c3        c4
 r1     0.037     0.297   180.000   131.000
 r2     0.008     0.786   314.000   287.000
 r3     0.002     1.000   444.000   416.000
 r4     0.007     0.678   596.000   609.000
 r5    -0.001     1.000   825.000   845.000
 r6     0.000     1.000   958.000  1008.000
 r7    -0.001     0.946   984.000  1173.000
 r8    -0.004     0.804  1012.000  1342.000
 r9    -0.003     0.800  1045.000  1560.000
r10    -0.012     0.349  1102.000  1854.000
r11    -0.011     0.353  1150.000  2007.000
r12    -0.010     0.403  1197.000  2194.000
r13    -0.012     0.310  1270.000  2364.000

. putexcel F3=matrix(B)
file Results/Tables/Table A3.xlsx saved

. 
. 
. ************************************************************************************
. * Table A4: Placebo test: 2nd placebo week before Poll1’s publication                                                         
. ************************************************************************************
. 
. use "Data/BM_PA.dta", clear

. 
. gen  z_p2 = 0 if t_inc==26.2
(33,835 missing values generated)

. replace  z_p2 = t_inc - 26.2 if t<19 
(16,058 real changes made)

. replace  z_p2 = t_inc - 26.2 if t>20 
(17,489 real changes made)

. 
. replace z_p2 = round(z_p2, .1)
(13,796 real changes made)

. 
. drop if z_p2 == 0
(283 observations deleted)

. 
. * Loop for getting results across the 13 windows
. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 -2.000001 -2.200001 -2.400001 -2
> .600001

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. 
. local n : word count `X'

. 
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. rdrandinf ivotd z_p2, seed(50) wl(`xi') wr(`yi')
  5. }

Selected window = [-.200001 ; .200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|        254         169        Reps          =           1000
   Mean of outcome|      0.843       0.834        Window        =    set by user
   S.D. of outcome|      0.365       0.373        H0:       tau =          0.000
            Window|     -0.200       0.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|     -0.008       0.885          0.823                  0.999
--------------------------------------------------------------------------------

Selected window = [-.400001 ; .400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|        458         412        Reps          =           1000
   Mean of outcome|      0.847       0.864        Window        =    set by user
   S.D. of outcome|      0.360       0.343        H0:       tau =          0.000
            Window|     -0.400       0.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.017       0.513          0.478                  1.000
--------------------------------------------------------------------------------

Selected window = [-.600001 ; .600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|        636         654        Reps          =           1000
   Mean of outcome|      0.857       0.856        Window        =    set by user
   S.D. of outcome|      0.350       0.351        H0:       tau =          0.000
            Window|     -0.600       0.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|     -0.001       1.000          0.973                  1.000
--------------------------------------------------------------------------------

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|        774         908        Reps          =           1000
   Mean of outcome|      0.864       0.861        Window        =    set by user
   S.D. of outcome|      0.343       0.346        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|     -0.003       0.898          0.854                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.000001 ; 1.000001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|       1040        1205        Reps          =           1000
   Mean of outcome|      0.866       0.868        Window        =    set by user
   S.D. of outcome|      0.340       0.339        H0:       tau =          0.000
            Window|     -1.000       1.000        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|      0.002       0.951          0.906                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.200001 ; 1.200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|       1266        1375        Reps          =           1000
   Mean of outcome|      0.868       0.864        Window        =    set by user
   S.D. of outcome|      0.339       0.343        H0:       tau =          0.000
            Window|     -1.200       1.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|     -0.004       0.793          0.758                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.400001 ; 1.400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|       1296        1596        Reps          =           1000
   Mean of outcome|      0.871       0.865        Window        =    set by user
   S.D. of outcome|      0.335       0.342        H0:       tau =          0.000
            Window|     -1.400       1.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|     -0.006       0.665          0.643                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.600001 ; 1.600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|       1339        1810        Reps          =           1000
   Mean of outcome|      0.872       0.864        Window        =    set by user
   S.D. of outcome|      0.334       0.343        H0:       tau =          0.000
            Window|     -1.600       1.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|     -0.008       0.508          0.500                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.800001 ; 1.800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|       1393        2040        Reps          =           1000
   Mean of outcome|      0.874       0.859        Window        =    set by user
   S.D. of outcome|      0.332       0.348        H0:       tau =          0.000
            Window|     -1.800       1.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|     -0.014       0.251          0.223                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.000001 ; 2.000001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|       1507        2297        Reps          =           1000
   Mean of outcome|      0.875       0.859        Window        =    set by user
   S.D. of outcome|      0.331       0.349        H0:       tau =          0.000
            Window|     -2.000       2.000        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|     -0.016       0.163          0.152                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.200001 ; 2.200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|       1582        2430        Reps          =           1000
   Mean of outcome|      0.874       0.857        Window        =    set by user
   S.D. of outcome|      0.332       0.350        H0:       tau =          0.000
            Window|     -2.200       2.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|     -0.016       0.150          0.135                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.400001 ; 2.400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|       1636        2575        Reps          =           1000
   Mean of outcome|      0.872       0.861        Window        =    set by user
   S.D. of outcome|      0.334       0.346        H0:       tau =          0.000
            Window|     -2.400       2.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|     -0.012       0.292          0.276                  1.000
--------------------------------------------------------------------------------

Selected window = [-2.600001 ; 2.600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33552
------------------+-----------------------        Order of poly =              0
     Number of obs|      18429       14543        Kernel type   =        uniform
Eff. Number of obs|       1710        2742        Reps          =           1000
   Mean of outcome|      0.870       0.865        Window        =    set by user
   S.D. of outcome|      0.336       0.342        H0:       tau =          0.000
            Window|     -2.600       2.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p2.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|     -0.005       0.639          0.624                  1.000
--------------------------------------------------------------------------------

. *
. 
. * Export results from Table A4
. *-----------------------------------------------------------------------------------
. 
. putexcel set "Results/Tables/Table A4", modify

. 
. local Ys 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 -2.000001 -2.200001 -2.400001 -2
> .600001

. 
. local n : word count `Y'

. 
. matrix A = J(13,3,.)

. 
. forvalues i=1/`n' {
  2. local yis : word `i' of `Ys'
  3. 
. 
. matrix A[`i',1] = `yis'
  4. }

. *
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. quietly: sum ivotd if z_p2 >= `xi' & z_p2 <= 0
  5.         scalar meanc = r(mean)
  6.         quietly: sum ivotd if z_p2 >= 0 & z_p2<= `yi'   
  7.         scalar meant = r(mean)
  8.         matrix A[`i',2] = meanc
  9.         matrix A[`i',3] = meant
 10. }

. *
. matrix list A, format(%4.3f)

A[13,3]
        c1     c2     c3
 r1  0.200  0.843  0.834
 r2  0.400  0.847  0.864
 r3  0.600  0.857  0.856
 r4  0.800  0.864  0.861
 r5  1.000  0.866  0.868
 r6  1.200  0.868  0.864
 r7  1.400  0.871  0.865
 r8  1.600  0.872  0.864
 r9  1.800  0.874  0.859
r10  2.000  0.875  0.859
r11  2.200  0.874  0.857
r12  2.400  0.872  0.861
r13  2.600  0.870  0.865

. putexcel C3=matrix(A)
file Results/Tables/Table A4.xlsx saved

. 
. matrix B = J(13,4,.)

. 
. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 -2.000001 -2.200001 -2.400001 -2
> .600001

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. 
. local n : word count `X'

. 
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. quietly:  rdrandinf ivotd z_p2, seed(50) wl(`xi') wr(`yi')
  5.     scalar diff = r(obs_stat)
  6.         scalar fpvalue = r(randpval)
  7.         scalar nleft = r(N_left)
  8.         scalar nright = r(N_right)
  9.         matrix B[`i',1] = diff
 10.         matrix B[`i',2] = fpvalue
 11.         matrix B[`i',3] = nleft
 12.         matrix B[`i',4] = nright
 13. }

. *
. matrix list B, format(%4.3f) 

B[13,4]
           c1        c2        c3        c4
 r1    -0.008     0.885   254.000   169.000
 r2     0.017     0.513   458.000   412.000
 r3    -0.001     1.000   636.000   654.000
 r4    -0.003     0.898   774.000   908.000
 r5     0.002     0.951  1040.000  1205.000
 r6    -0.004     0.793  1266.000  1375.000
 r7    -0.006     0.665  1296.000  1596.000
 r8    -0.008     0.508  1339.000  1810.000
 r9    -0.014     0.251  1393.000  2040.000
r10    -0.016     0.163  1507.000  2297.000
r11    -0.016     0.150  1582.000  2430.000
r12    -0.012     0.292  1636.000  2575.000
r13    -0.005     0.639  1710.000  2742.000

. putexcel F3=matrix(B)
file Results/Tables/Table A4.xlsx saved

. 
. 
. ************************************************************************************
. * Table A5: Placebo test: 3rd placebo week after Poll1’s publication                                                          
. ************************************************************************************
. 
. use "Data/BM_PA.dta", clear

. 
. gen  z_p_right = 0 if z==1.4
(33,835 missing values generated)

. replace  z_p_right = z - 1.4 if t<19 
(16,058 real changes made)

. replace  z_p_right = z - 1.4 if t>20 
(17,489 real changes made)

. 
. replace z_p_right = round(z_p_right, .1)
(9,625 real changes made)

. 
. drop if z_p_right == 0
(133 observations deleted)

. 
. ** set up  the new window size macros 
. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 

. 
. local n : word count `X'

. 
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. rdrandinf ivotd z_p_right, seed(50) wl(`xi') wr(`yi')
  5. }

Selected window = [-.200001 ; .200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33702
------------------+-----------------------        Order of poly =              0
     Number of obs|      30204        2914        Kernel type   =        uniform
Eff. Number of obs|        108         114        Reps          =           1000
   Mean of outcome|      0.917       0.904        Window        =    set by user
   S.D. of outcome|      0.278       0.297        H0:       tau =          0.000
            Window|     -0.200       0.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p_right.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.14
------------------+-------------------------------------------------------------
    Diff. in means|     -0.013       0.824          0.733                  0.950
--------------------------------------------------------------------------------

Selected window = [-.400001 ; .400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33702
------------------+-----------------------        Order of poly =              0
     Number of obs|      30204        2914        Kernel type   =        uniform
Eff. Number of obs|        265         272        Reps          =           1000
   Mean of outcome|      0.887       0.908        Window        =    set by user
   S.D. of outcome|      0.317       0.289        H0:       tau =          0.000
            Window|     -0.400       0.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p_right.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|      0.021       0.464          0.417                  1.000
--------------------------------------------------------------------------------

Selected window = [-.600001 ; .600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33702
------------------+-----------------------        Order of poly =              0
     Number of obs|      30204        2914        Kernel type   =        uniform
Eff. Number of obs|        408         484        Reps          =           1000
   Mean of outcome|      0.887       0.903        Window        =    set by user
   S.D. of outcome|      0.317       0.296        H0:       tau =          0.000
            Window|     -0.600       0.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p_right.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|      0.016       0.520          0.449                  1.000
--------------------------------------------------------------------------------

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33702
------------------+-----------------------        Order of poly =              0
     Number of obs|      30204        2914        Kernel type   =        uniform
Eff. Number of obs|        537         606        Reps          =           1000
   Mean of outcome|      0.890       0.901        Window        =    set by user
   S.D. of outcome|      0.313       0.299        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p_right.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.16
------------------+-------------------------------------------------------------
    Diff. in means|      0.011       0.560          0.550                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.000001 ; 1.000001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33702
------------------+-----------------------        Order of poly =              0
     Number of obs|      30204        2914        Kernel type   =        uniform
Eff. Number of obs|        683         747        Reps          =           1000
   Mean of outcome|      0.899       0.898        Window        =    set by user
   S.D. of outcome|      0.302       0.303        H0:       tau =          0.000
            Window|     -1.000       1.000        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p_right.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.15
------------------+-------------------------------------------------------------
    Diff. in means|     -0.001       1.000          0.964                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.200001 ; 1.200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33702
------------------+-----------------------        Order of poly =              0
     Number of obs|      30204        2914        Kernel type   =        uniform
Eff. Number of obs|        810         862        Reps          =           1000
   Mean of outcome|      0.893       0.890        Window        =    set by user
   S.D. of outcome|      0.310       0.313        H0:       tau =          0.000
            Window|     -1.200       1.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_p_right.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.15
------------------+-------------------------------------------------------------
    Diff. in means|     -0.003       0.880          0.854                  1.000
--------------------------------------------------------------------------------

. *
. 
. * Export results from Table A5
. *-----------------------------------------------------------------------------------
. 
. putexcel set "Results/Tables/Table A5", modify

. 
. 
. local Ys 0.2 0.4 0.6 0.8 1.0 1.2

. local Y  0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 

. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 

. 
. local n : word count `Y'

. 
. matrix A = J(7,3,.)

. 
. forvalues i=1/`n' {
  2. local yis : word `i' of `Ys'
  3. 
. 
. matrix A[`i',1] = `yis'
  4. }

. *
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. quietly: sum ivotd if z_p_right >= `xi' & z_p_right <= 0
  5.         scalar meanc = r(mean)
  6.         quietly: sum ivotd if z_p_right >= 0 & z_p_right<= `yi' 
  7.         scalar meant = r(mean)
  8.         matrix A[`i',2] = meanc
  9.         matrix A[`i',3] = meant
 10. }

. *
. matrix list A, format(%4.3f)

A[7,3]
       c1     c2     c3
r1  0.200  0.917  0.904
r2  0.400  0.887  0.908
r3  0.600  0.887  0.903
r4  0.800  0.890  0.901
r5  1.000  0.899  0.898
r6  1.200  0.893  0.890
r7      .      .      .

. putexcel C3=matrix(A)
file Results/Tables/Table A5.xlsx saved

. 
. 
. forvalues i=1/`n' {
  2. local yi : word `i' of `Y'
  3. matrix A[`i',1] = `yi'
  4. }

. *
. matrix list A, format(%4.3f)

A[7,3]
       c1     c2     c3
r1  0.200  0.917  0.904
r2  0.400  0.887  0.908
r3  0.600  0.887  0.903
r4  0.800  0.890  0.901
r5  1.000  0.899  0.898
r6  1.200  0.893  0.890
r7      .      .      .

. putexcel C3=matrix(A)
file Results/Tables/Table A5.xlsx saved

.  
. matrix B = J(7,4,.)

. 
. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 

. local Y 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 

. local n : word count `X'

. 
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. quietly: rdrandinf ivotd z_p_right, seed(50) wl(`xi') wr(`yi')
  5.     scalar diff = r(obs_stat)
  6.         scalar fpvalue = r(randpval)
  7.         scalar nleft = r(N_left)
  8.         scalar nright = r(N_right)
  9.         matrix B[`i',1] = diff
 10.         matrix B[`i',2] = fpvalue
 11.         matrix B[`i',3] = nleft
 12.         matrix B[`i',4] = nright
 13. }

. *
. matrix list B, format(%4.3f) 

B[7,4]
         c1       c2       c3       c4
r1   -0.013    0.824  108.000  114.000
r2    0.021    0.464  265.000  272.000
r3    0.016    0.520  408.000  484.000
r4    0.011    0.560  537.000  606.000
r5   -0.001    1.000  683.000  747.000
r6   -0.003    0.880  810.000  862.000
r7        .        .        .        .

. putexcel F3=matrix(B)
file Results/Tables/Table A5.xlsx saved

. 
. 
. ************************************************************************************
. * Table A6: Density test of the running variable                                                                                  
>                       
. ************************************************************************************
. 
. use "Data/BM_PA.dta", clear

. 
. drop if z == 0
(204 observations deleted)

. 
. rdwinselect z, wmin(0.800001) nwindows(1) seed(50)


Window selection for RD under local randomization


Cutoff c = 0.00   | Left of c   Right of c        Number of obs  =         33631
------------------+-----------------------        Order of poly  =             0
    Number of obs |     29422         4209        Kernel type    =       uniform
   1st percentile |       417            0        Reps           =          1000
   5th percentile |      1601          127        Testing method =     rdrandinf
  10th percentile |      2959          277        Balance test   =         ttest
  20th percentile |      6090          714


                  |   Bal. test         Var. name    Bin. test 
 Window length /2 |    p-value        (min p-value)   p-value     Obs<c   Obs>=c
------------------+-------------------------------------------------------------
            0.800 |         .                 -         0.881       559      553

Variable used in binomial test (running variable): z

Note: no covariates specified.
Need to specify covariates to find recommended length.

. 
. * Export results from Table A6
. *-----------------------------------------------------------------------------------
. 
. * Done manually as rdwinselect does not store the needed output
. 
. 
. ************************************************************************************
. * Table A7: Conservative estimation                                                                                               
>                                        
. ************************************************************************************
. 
. use "Data/BM_PA.dta", clear

. 
. gen inc_con = .     
(33,835 missing values generated)

. replace inc_con = 0 if hour==1
(7,635 real changes made)

. replace inc_con = 0.20000000 if hour==2
(9,743 real changes made)

. replace inc_con = 0.40000000 if hour==3
(5,257 real changes made)

. replace inc_con = 0.60000000 if hour==4
(5,815 real changes made)

. replace inc_con = 0.80000000  if hour==5
(5,097 real changes made)

.                 
. gen t_inc_con = t+inc_con
(288 missing values generated)

. drop if t_inc_con >39.8 & t_inc_con < 41 
(784 observations deleted)

. replace t_inc_con=t_inc_con  + 1 if t_inc_con < 41 
(29,251 real changes made)

. 
. gen  z_con = 0 if t_inc_con==41
(32,907 missing values generated)

. replace  z_con = t_inc_con - 41 if t<19 
(16,058 real changes made)

. replace  z_con = t_inc_con - 41 if t>20 
(16,561 real changes made)

. 
. replace z_con=z_con  + 0.2 if z_con >=0 
(3,512 real changes made)

.                 
. replace z_con = round(z_con, .1)
(10,355 real changes made)

.                 
. ** set up  the new window size macros 
. local X_ -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 

. local Y_ 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 

. 
. local n : word count `X_'

. 
. forvalues i=1/`n' {
  2. local x_i : word `i' of `X_'
  3. local y_i : word `i' of `Y_'
  4. 
. rdrandinf ivotd z_con, seed(50) wl(`x_i') wr(`y_i')
  5. }

Selected window = [-.200001 ; .200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33051
------------------+-----------------------        Order of poly =              0
     Number of obs|      29022        3453        Kernel type   =        uniform
Eff. Number of obs|        105         143        Reps          =           1000
   Mean of outcome|      0.924       0.888        Window        =    set by user
   S.D. of outcome|      0.267       0.316        H0:       tau =          0.000
            Window|     -0.200       0.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_con.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.13
------------------+-------------------------------------------------------------
    Diff. in means|     -0.036       0.400          0.336                  0.949
--------------------------------------------------------------------------------

Selected window = [-.400001 ; .400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33051
------------------+-----------------------        Order of poly =              0
     Number of obs|      29022        3453        Kernel type   =        uniform
Eff. Number of obs|        241         300        Reps          =           1000
   Mean of outcome|      0.871       0.877        Window        =    set by user
   S.D. of outcome|      0.335       0.329        H0:       tau =          0.000
            Window|     -0.400       0.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_con.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|      0.005       0.885          0.854                  1.000
--------------------------------------------------------------------------------

Selected window = [-.600001 ; .600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33051
------------------+-----------------------        Order of poly =              0
     Number of obs|      29022        3453        Kernel type   =        uniform
Eff. Number of obs|        382         408        Reps          =           1000
   Mean of outcome|      0.856       0.887        Window        =    set by user
   S.D. of outcome|      0.352       0.317        H0:       tau =          0.000
            Window|     -0.600       0.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_con.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.031       0.200          0.191                  1.000
--------------------------------------------------------------------------------

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33051
------------------+-----------------------        Order of poly =              0
     Number of obs|      29022        3453        Kernel type   =        uniform
Eff. Number of obs|        596         539        Reps          =           1000
   Mean of outcome|      0.856       0.879        Window        =    set by user
   S.D. of outcome|      0.352       0.326        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_con.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.024       0.265          0.239                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.000001 ; 1.000001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33051
------------------+-----------------------        Order of poly =              0
     Number of obs|      29022        3453        Kernel type   =        uniform
Eff. Number of obs|        752         653        Reps          =           1000
   Mean of outcome|      0.854       0.884        Window        =    set by user
   S.D. of outcome|      0.354       0.321        H0:       tau =          0.000
            Window|     -1.000       1.000        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_con.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.030       0.123          0.097                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.200001 ; 1.200001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33051
------------------+-----------------------        Order of poly =              0
     Number of obs|      29022        3453        Kernel type   =        uniform
Eff. Number of obs|        761         811        Reps          =           1000
   Mean of outcome|      0.853       0.889        Window        =    set by user
   S.D. of outcome|      0.355       0.314        H0:       tau =          0.000
            Window|     -1.200       1.200        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_con.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.036       0.041          0.033                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.400001 ; 1.400001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33051
------------------+-----------------------        Order of poly =              0
     Number of obs|      29022        3453        Kernel type   =        uniform
Eff. Number of obs|        777        1023        Reps          =           1000
   Mean of outcome|      0.855       0.891        Window        =    set by user
   S.D. of outcome|      0.353       0.312        H0:       tau =          0.000
            Window|     -1.400       1.400        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_con.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.036       0.016          0.025                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.600001 ; 1.600001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33051
------------------+-----------------------        Order of poly =              0
     Number of obs|      29022        3453        Kernel type   =        uniform
Eff. Number of obs|        812        1145        Reps          =           1000
   Mean of outcome|      0.855       0.891        Window        =    set by user
   S.D. of outcome|      0.353       0.312        H0:       tau =          0.000
            Window|     -1.600       1.600        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_con.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.18
------------------+-------------------------------------------------------------
    Diff. in means|      0.036       0.020          0.019                  1.000
--------------------------------------------------------------------------------

Selected window = [-1.800001 ; 1.800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33051
------------------+-----------------------        Order of poly =              0
     Number of obs|      29022        3453        Kernel type   =        uniform
Eff. Number of obs|        886        1286        Reps          =           1000
   Mean of outcome|      0.858       0.890        Window        =    set by user
   S.D. of outcome|      0.349       0.313        H0:       tau =          0.000
            Window|     -1.800       1.800        Randomization =  fixed margins

Outcome: ivotd. Running variable: z_con.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.17
------------------+-------------------------------------------------------------
    Diff. in means|      0.033       0.022          0.026                  1.000
--------------------------------------------------------------------------------

. *
. 
. * Export results from Table A7
. *-----------------------------------------------------------------------------------
. 
. putexcel set "Results/Tables/Table A7", modify

. 
. local Z 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 2.000001 2.200001 2.400001 2.600001

. local n : word count `Z'

. 
. matrix A = J(13,8,.)

. 
. forvalues i=1/`n' {
  2. local zi : word `i' of `Z'
  3. matrix A[`i',1] = `zi'
  4. }

. *
. matrix list A, format(%4.3f)

A[13,8]
        c1     c2     c3     c4     c5     c6     c7     c8
 r1  0.200      .      .      .      .      .      .      .
 r2  0.400      .      .      .      .      .      .      .
 r3  0.600      .      .      .      .      .      .      .
 r4  0.800      .      .      .      .      .      .      .
 r5  1.000      .      .      .      .      .      .      .
 r6  1.200      .      .      .      .      .      .      .
 r7  1.400      .      .      .      .      .      .      .
 r8  1.600      .      .      .      .      .      .      .
 r9  1.800      .      .      .      .      .      .      .
r10  2.000      .      .      .      .      .      .      .
r11  2.200      .      .      .      .      .      .      .
r12  2.400      .      .      .      .      .      .      .
r13  2.600      .      .      .      .      .      .      .

. putexcel C3=matrix(A)
file Results/Tables/Table A7.xlsx saved

. 
. 
. local Ys 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001

. local Y  0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001

. local X -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001

. 
. local n : word count `Y'

. 
. matrix B = J(9,3,.)

. 
. forvalues i=1/`n' {
  2. local yis : word `i' of `Ys'
  3. matrix B[`i',1] = `yis'
  4. }

. *
. forvalues i=1/`n' {
  2. local xi : word `i' of `X'
  3. local yi : word `i' of `Y'
  4. 
. quietly: sum ivotd if z_con >= `xi' & z_con <= 0
  5.         scalar meanc = r(mean)
  6.         quietly: sum ivotd if z_con >= 0 & z_con<= `yi' 
  7.         scalar meant = r(mean)
  8.         matrix B[`i',2] = meanc
  9.         matrix B[`i',3] = meant
 10. }

. *
. matrix list B, format(%4.3f)

B[9,3]
       c1     c2     c3
r1  0.200  0.924  0.888
r2  0.400  0.871  0.877
r3  0.600  0.856  0.887
r4  0.800  0.856  0.879
r5  1.000  0.854  0.884
r6  1.200  0.853  0.889
r7  1.400  0.855  0.891
r8  1.600  0.855  0.891
r9  1.800  0.858  0.890

. putexcel D7=matrix(B)
file Results/Tables/Table A7.xlsx saved

. 
. 
. matrix C = J(9,4,.)

. 
. local X_ -0.200001 -0.400001 -0.600001 -0.800001 -1.000001 -1.200001 -1.400001 -1.600001 -1.800001 

. local Y_ 0.200001 0.400001 0.600001 0.800001 1.000001 1.200001 1.400001 1.600001 1.800001 

. 
. local n : word count `X_'

. 
. forvalues i=1/`n' {
  2. local x_i : word `i' of `X_'
  3. local y_i : word `i' of `Y_'
  4. 
. quietly: rdrandinf ivotd z_con, seed(50) wl(`x_i') wr(`y_i')
  5.     scalar diff = r(obs_stat)
  6.         scalar fpvalue = r(randpval)
  7.         scalar nleft = r(N_left)
  8.         scalar nright = r(N_right)
  9.         matrix C[`i',1] = diff
 10.         matrix C[`i',2] = fpvalue
 11.         matrix C[`i',3] = nleft
 12.         matrix C[`i',4] = nright
 13. }

. *
. 
. matrix list C, format(%4.3f) 

C[9,4]
          c1        c2        c3        c4
r1    -0.036     0.400   105.000   143.000
r2     0.005     0.885   241.000   300.000
r3     0.031     0.200   382.000   408.000
r4     0.024     0.265   596.000   539.000
r5     0.030     0.123   752.000   653.000
r6     0.036     0.041   761.000   811.000
r7     0.036     0.016   777.000  1023.000
r8     0.036     0.020   812.000  1145.000
r9     0.033     0.022   886.000  1286.000

. putexcel G7=matrix(C)
file Results/Tables/Table A7.xlsx saved

. 
. set more off

. 
. ************************************************************************************************
. * Table A8: Representativeness of the sample: comparing the sample we use with the total sample                 
. ************************************************************************************************
. 
. use "Data/BM_PA.dta", clear

. 
. * Panel A: 0.8 window
. 
. preserve

. 
. drop if z == 0
(204 observations deleted)

. drop if z <= -0.800001
(28,863 observations deleted)

. drop if z >= 0.800001 
(3,656 observations deleted)

. gen sample = 1

. save "Data/BM_PA_0_8w.dta", replace
file Data/BM_PA_0_8w.dta saved

. 
. use "Data/BM_PA.dta", clear

. 
. append  using "Data/BM_PA_0_8w"
(label E101 already defined)
(label TAMUNI already defined)
(label hlabel already defined)

. replace sample = 0 if sample != 1
(33,835 real changes made)

. 
. local vars female a30 a40 a50 a60 a70 a80 urban1 urban2 urban3

. foreach var of local vars {
  2.     ttest `var' if  ivotd !=., by(sample)
  3. }

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .5146427    .0027294     .499793    .5092931    .5199924
       1 |   1,096    .5164234    .0151018    .4999583    .4867916    .5460551
---------+--------------------------------------------------------------------
combined |  34,628    .5146991    .0026858    .4997911    .5094348    .5199634
---------+--------------------------------------------------------------------
    diff |           -.0017806    .0153417               -.0318509    .0282896
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -0.1161
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.4538         Pr(|T| > |t|) = 0.9076          Pr(T > t) = 0.5462

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1354527    .0018688    .3422116    .1317898    .1391156
       1 |   1,096    .1350365     .010328    .3419186    .1147715    .1553015
---------+--------------------------------------------------------------------
combined |  34,628    .1354395    .0018389    .3421974    .1318352    .1390439
---------+--------------------------------------------------------------------
    diff |            .0004162    .0105042               -.0201723    .0210047
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   0.0396
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.5158         Pr(|T| > |t|) = 0.9684          Pr(T > t) = 0.4842

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1545986    .0019743     .361527    .1507289    .1584683
       1 |   1,096    .1779197    .0115575    .3826197    .1552425     .200597
---------+--------------------------------------------------------------------
combined |  34,628    .1553367    .0019466    .3622306    .1515214    .1591521
---------+--------------------------------------------------------------------
    diff |           -.0233211    .0111184               -.0451136   -.0015287
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -2.0975
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0180         Pr(|T| > |t|) = 0.0360          Pr(T > t) = 0.9820

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1918764    .0021504    .3937823    .1876615    .1960913
       1 |   1,096    .1788321    .0115806    .3833866    .1561094    .2015548
---------+--------------------------------------------------------------------
combined |  34,628    .1914636    .0021144    .3934587    .1873193    .1956078
---------+--------------------------------------------------------------------
    diff |            .0130443    .0120775                -.010628    .0367166
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   1.0801
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.8599         Pr(|T| > |t|) = 0.2801          Pr(T > t) = 0.1401

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1812597    .0021038    .3852389    .1771362    .1853832
       1 |   1,096    .1788321    .0115806    .3833866    .1561094    .2015548
---------+--------------------------------------------------------------------
combined |  34,628    .1811829    .0020699    .3851752    .1771258    .1852399
---------+--------------------------------------------------------------------
    diff |            .0024276    .0118234               -.0207467    .0256019
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   0.2053
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.5813         Pr(|T| > |t|) = 0.8373          Pr(T > t) = 0.4187

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1562686     .001983    .3631152     .152382    .1601553
       1 |   1,096    .1687956    .0113195    .3747423    .1465852     .191006
---------+--------------------------------------------------------------------
combined |  34,628    .1566651    .0019533      .36349    .1528365    .1604937
---------+--------------------------------------------------------------------
    diff |            -.012527    .0111576               -.0343962    .0093422
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -1.1227
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.1308         Pr(|T| > |t|) = 0.2616          Pr(T > t) = 0.8692

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532     .180544    .0021005    .3846456    .1764268    .1846611
       1 |   1,096    .1605839    .0110951    .3673144    .1388138    .1823541
---------+--------------------------------------------------------------------
combined |  34,628    .1799122    .0020642    .3841199    .1758663    .1839581
---------+--------------------------------------------------------------------
    diff |              .01996    .0117905               -.0031498    .0430699
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   1.6929
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9548         Pr(|T| > |t|) = 0.0905          Pr(T > t) = 0.0452

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .2563223    .0023843    .4366084     .251649    .2609956
       1 |   1,096    .1678832    .0112951    .3739332    .1457208    .1900456
---------+--------------------------------------------------------------------
combined |  34,628    .2535232    .0023378    .4350341     .248941    .2581053
---------+--------------------------------------------------------------------
    diff |            .0884391    .0133454                .0622816    .1145966
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   6.6269
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .5882142    .0026877    .4921641    .5829463    .5934822
       1 |   1,096        .625    .0146301    .4843439    .5962937    .6537063
---------+--------------------------------------------------------------------
combined |  34,628    .5893785    .0026437    .4919537    .5841968    .5945603
---------+--------------------------------------------------------------------
    diff |           -.0367858    .0150998               -.0663819   -.0071896
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -2.4362
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0074         Pr(|T| > |t|) = 0.0148          Pr(T > t) = 0.9926

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1554634    .0019788    .3623513    .1515849    .1593419
       1 |   1,096    .2071168    .0122463     .405425    .1830879    .2311457
---------+--------------------------------------------------------------------
combined |  34,628    .1570983    .0019555    .3638987    .1532654    .1609312
---------+--------------------------------------------------------------------
    diff |           -.0516534    .0111669               -.0735408   -.0297659
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -4.6256
Ho: diff = 0                                     degrees of freedom =    34626

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. *
. restore

. 
. * Panel B: 2.6 window
. 
. preserve

. drop if z == 0
(204 observations deleted)

. drop if z <= -2.600001
(28,160 observations deleted)

. drop if z >= 2.600001 
(2,377 observations deleted)

. gen sample = 1

. save "Data/BM_PA_2_6w.dta", replace
file Data/BM_PA_2_6w.dta saved

. 
. use "Data/BM_PA.dta", clear

. 
. append  using "Data/BM_PA_2_6w"
(label hlabel already defined)
(label TAMUNI already defined)
(label E101 already defined)

. replace sample = 0 if sample != 1
(33,835 real changes made)

. 
. local vars female a30 a40 a50 a60 a70 a80 urban1 urban2 urban3

. foreach var of local vars {
  2.     ttest `var' if  ivotd !=., by(sample)
  3. }

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .5146427    .0027294     .499793    .5092931    .5199924
       1 |   3,047    .5178864    .0090537     .499762    .5001344    .5356385
---------+--------------------------------------------------------------------
combined |  36,579    .5149129    .0026132    .4997844    .5097911    .5200348
---------+--------------------------------------------------------------------
    diff |           -.0032437    .0094567                -.021779    .0152916
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -0.3430
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.3658         Pr(|T| > |t|) = 0.7316          Pr(T > t) = 0.6342

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1354527    .0018688    .3422116    .1317898    .1391156
       1 |   3,047    .1358713    .0062085    .3427081     .123698    .1480447
---------+--------------------------------------------------------------------
combined |  36,579    .1354876    .0017895    .3422483    .1319802     .138995
---------+--------------------------------------------------------------------
    diff |           -.0004186    .0064759               -.0131115    .0122742
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -0.0646
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.4742         Pr(|T| > |t|) = 0.9485          Pr(T > t) = 0.5258

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1545986    .0019743     .361527    .1507289    .1584683
       1 |   3,047    .1588448    .0066231    .3655913    .1458586    .1718309
---------+--------------------------------------------------------------------
combined |  36,579    .1549523     .001892    .3618641    .1512438    .1586607
---------+--------------------------------------------------------------------
    diff |           -.0042462     .006847               -.0176665    .0091741
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -0.6202
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.2676         Pr(|T| > |t|) = 0.5352          Pr(T > t) = 0.7324

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1918764    .0021504    .3937823    .1876615    .1960913
       1 |   3,047    .1903512    .0071131    .3926426    .1764041    .2042982
---------+--------------------------------------------------------------------
combined |  36,579    .1917494    .0020584    .3936823    .1877148    .1957839
---------+--------------------------------------------------------------------
    diff |            .0015253    .0074491               -.0130751    .0161256
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   0.2048
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.5811         Pr(|T| > |t|) = 0.8378          Pr(T > t) = 0.4189

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1812597    .0021038    .3852389    .1771362    .1853832
       1 |   3,047    .1732852    .0068579    .3785558    .1598385    .1867319
---------+--------------------------------------------------------------------
combined |  36,579    .1805954    .0020114    .3846879    .1766531    .1845378
---------+--------------------------------------------------------------------
    diff |            .0079745    .0072788               -.0062921    .0222411
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   1.0956
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.8634         Pr(|T| > |t|) = 0.2733          Pr(T > t) = 0.1366

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1562686     .001983    .3631152     .152382    .1601553
       1 |   3,047    .1667214    .0067535    .3727881    .1534796    .1799631
---------+--------------------------------------------------------------------
combined |  36,579    .1571393    .0019029    .3639371    .1534097     .160869
---------+--------------------------------------------------------------------
    diff |           -.0104527     .006886               -.0239495    .0030441
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -1.5180
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0645         Pr(|T| > |t|) = 0.1290          Pr(T > t) = 0.9355

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532     .180544    .0021005    .3846456    .1764268    .1846611
       1 |   3,047    .1749262    .0068835    .3799663    .1614294    .1884229
---------+--------------------------------------------------------------------
combined |  36,579     .180076    .0020091     .384256    .1761381    .1840139
---------+--------------------------------------------------------------------
    diff |            .0056178    .0072706               -.0086329    .0198685
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   0.7727
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.7801         Pr(|T| > |t|) = 0.4397          Pr(T > t) = 0.2199

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .2563223    .0023843    .4366084     .251649    .2609956
       1 |   3,047    .2182475    .0074842    .4131241    .2035729     .232922
---------+--------------------------------------------------------------------
combined |  36,579    .2531507    .0022735    .4348225    .2486946    .2576069
---------+--------------------------------------------------------------------
    diff |            .0380749    .0082251                .0219534    .0541963
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   4.6291
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .5882142    .0026877    .4921641    .5829463    .5934822
       1 |   3,047    .5700689    .0089701    .4951473    .5524808     .587657
---------+--------------------------------------------------------------------
combined |  36,579    .5867028    .0025747     .492432    .5816562    .5917493
---------+--------------------------------------------------------------------
    diff |            .0181453    .0093171               -.0001164    .0364071
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   1.9475
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9743         Pr(|T| > |t|) = 0.0515          Pr(T > t) = 0.0257

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |  33,532    .1554634    .0019788    .3623513    .1515849    .1593419
       1 |   3,047    .2116836    .0074017    .4085688    .1971709    .2261964
---------+--------------------------------------------------------------------
combined |  36,579    .1601465    .0019176    .3667469     .156388     .163905
---------+--------------------------------------------------------------------
    diff |           -.0562202    .0069332               -.0698094    -.042631
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -8.1089
Ho: diff = 0                                     degrees of freedom =    36577

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. *
. restore

. 
. * Export results from Table A8
. *-----------------------------------------------------------------------------------
. 
. ** Panel A: 0.8 window
. 
. use "Data/BM_PA.dta", clear

. 
. append  using "Data/BM_PA_0_8w"
(label E101 already defined)
(label TAMUNI already defined)
(label hlabel already defined)

. replace sample = 0 if sample != 1
(33,835 real changes made)

. 
. 
. putexcel set "Results/Tables/Table A8", modify

. 
. matrix A = J(10,6,.) 

. 
. local i = 1

. local vars female a30 a40 a50 a60 a70 a80 urban1 urban2 urban3

. foreach var of local vars {
  2.         tempname `var'
  3.     quietly: ttest `var' if  ivotd !=., by(sample)
  4.         scalar meantotal``var''= r(mu_1)
  5.         scalar meanrestricted``var'' = r(mu_2)
  6.         scalar pvalue``var'' = r(p)
  7.         scalar ntotal``var'' = r(N_1)
  8.         scalar nrestricted``var'' = r(N_2)
  9.         matrix A[`i',1] = meantotal``var''
 10.         matrix A[`i',2] = meanrestricted``var''
 11.         matrix A[`i',3] = meantotal``var'' - meanrestricted``var''
 12.         matrix A[`i',4] = pvalue``var''
 13.         matrix A[`i',5] = ntotal``var''
 14.         matrix A[`i',6] = nrestricted``var'' 
 15.         local ++i
 16. }

. *
. matrix list A, format(%4.3f)

A[10,6]
           c1        c2        c3        c4        c5        c6
 r1     0.515     0.516    -0.002     0.908   3.4e+04  1096.000
 r2     0.135     0.135     0.000     0.968   3.4e+04  1096.000
 r3     0.155     0.178    -0.023     0.036   3.4e+04  1096.000
 r4     0.192     0.179     0.013     0.280   3.4e+04  1096.000
 r5     0.181     0.179     0.002     0.837   3.4e+04  1096.000
 r6     0.156     0.169    -0.013     0.262   3.4e+04  1096.000
 r7     0.181     0.161     0.020     0.090   3.4e+04  1096.000
 r8     0.256     0.168     0.088     0.000   3.4e+04  1096.000
 r9     0.588     0.625    -0.037     0.015   3.4e+04  1096.000
r10     0.155     0.207    -0.052     0.000   3.4e+04  1096.000

. putexcel C3=matrix(A)
file Results/Tables/Table A8.xlsx saved

. 
. ** Panel B: 2.6 window
. 
. use "Data/BM_PA.dta", clear

. 
. append  using "Data/BM_PA_2_6w"
(label hlabel already defined)
(label TAMUNI already defined)
(label E101 already defined)

. replace sample = 0 if sample != 1
(33,835 real changes made)

. 
. 
. putexcel set "Results/Tables/Table A8", modify

. 
. matrix A = J(10,6,.) 

. 
. 
. local i = 1

. local vars female a30 a40 a50 a60 a70 a80 urban1 urban2 urban3

. foreach var of local vars {
  2.         tempname `var'
  3.     quietly: ttest `var' if  ivotd !=., by(sample)
  4.         scalar meantotal``var''= r(mu_1)
  5.         scalar meanrestricted``var'' = r(mu_2)
  6.         scalar pvalue``var'' = r(p)
  7.         scalar ntotal``var'' = r(N_1)
  8.         scalar nrestricted``var'' = r(N_2)
  9.         matrix A[`i',1] = meantotal``var''
 10.         matrix A[`i',2] = meanrestricted``var''
 11.         matrix A[`i',4] = pvalue``var''
 12.         matrix A[`i',3] = meantotal``var'' - meanrestricted``var''
 13.         matrix A[`i',5] = ntotal``var''
 14.         matrix A[`i',6] = nrestricted``var'' 
 15.         local ++i
 16. }

. *
. matrix list A, format(%4.3f)

A[10,6]
           c1        c2        c3        c4        c5        c6
 r1     0.515     0.518    -0.003     0.732   3.4e+04  3047.000
 r2     0.135     0.136    -0.000     0.948   3.4e+04  3047.000
 r3     0.155     0.159    -0.004     0.535   3.4e+04  3047.000
 r4     0.192     0.190     0.002     0.838   3.4e+04  3047.000
 r5     0.181     0.173     0.008     0.273   3.4e+04  3047.000
 r6     0.156     0.167    -0.010     0.129   3.4e+04  3047.000
 r7     0.181     0.175     0.006     0.440   3.4e+04  3047.000
 r8     0.256     0.218     0.038     0.000   3.4e+04  3047.000
 r9     0.588     0.570     0.018     0.051   3.4e+04  3047.000
r10     0.155     0.212    -0.056     0.000   3.4e+04  3047.000

. putexcel C15=matrix(A)
file Results/Tables/Table A8.xlsx saved

. 
. 
. ************************************************************************************
. * Table A9: The effect of Poll1’ on vote choice: 0.8 days window
. ************************************************************************************
. 
. use "Data/BM_PA.dta", clear

. 
. * Donut hole
. drop if z == 0
(204 observations deleted)

. 
. foreach var of varlist ivotopsoe ivotopp ivotocs ivotops ivotovox{
  2. rdrandinf `var' z, seed(50) wl(-0.800001) wr(0.800001)
  3. }

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      13677        3203        Kernel type   =        uniform
Eff. Number of obs|        442         458        Reps          =           1000
   Mean of outcome|      0.219       0.238        Window        =    set by user
   S.D. of outcome|      0.414       0.426        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotopsoe. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.21
------------------+-------------------------------------------------------------
    Diff. in means|      0.019       0.517          0.508                  1.000
--------------------------------------------------------------------------------

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      23647        3203        Kernel type   =        uniform
Eff. Number of obs|        442         458        Reps          =           1000
   Mean of outcome|      0.084       0.109        Window        =    set by user
   S.D. of outcome|      0.277       0.312        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotopp. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.14
------------------+-------------------------------------------------------------
    Diff. in means|      0.025       0.217          0.195                  1.000
--------------------------------------------------------------------------------

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      23647        3203        Kernel type   =        uniform
Eff. Number of obs|        442         458        Reps          =           1000
   Mean of outcome|      0.066       0.081        Window        =    set by user
   S.D. of outcome|      0.248       0.273        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotocs. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.12
------------------+-------------------------------------------------------------
    Diff. in means|      0.015       0.417          0.382                  1.000
--------------------------------------------------------------------------------

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      23647        3203        Kernel type   =        uniform
Eff. Number of obs|        442         458        Reps          =           1000
   Mean of outcome|      0.081       0.074        Window        =    set by user
   S.D. of outcome|      0.274       0.262        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotops. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.14
------------------+-------------------------------------------------------------
    Diff. in means|     -0.007       0.720          0.687                  1.000
--------------------------------------------------------------------------------

Selected window = [-.800001 ; .800001]

Running randomization-based test...
Randomization-based test complete.


Inference for sharp design


Cutoff c = 0.00   |  Left of c  Right of c        Number of obs =          33631
------------------+-----------------------        Order of poly =              0
     Number of obs|      23647        3203        Kernel type   =        uniform
Eff. Number of obs|        442         458        Reps          =           1000
   Mean of outcome|      0.054       0.044        Window        =    set by user
   S.D. of outcome|      0.227       0.205        H0:       tau =          0.000
            Window|     -0.800       0.800        Randomization =  fixed margins

Outcome: ivotovox. Running variable: z.
--------------------------------------------------------------------------------
                  |              Finite sample             Large sample
                  |             ---------------  -------------------------------
         Statistic|      T           P>|T|         P>|T|   Power vs d =     0.11
------------------+-------------------------------------------------------------
    Diff. in means|     -0.011       0.566          0.461                  1.000
--------------------------------------------------------------------------------

. *
. 
. * Export results from Table A9
. *-----------------------------------------------------------------------------------
. 
. putexcel set "Results/Tables/Table A9", modify

. 
. matrix A = J(5,6,.) 

. 
. local i = 1

. 
. foreach var of varlist ivotopsoe ivotopp ivotocs ivotops ivotovox{
  2.         tempname `var'
  3.         quietly: sum `var' if z >= -0.800001 & z <= 0
  4.         scalar meanc``var'' = r(mean)
  5.         quietly: sum `var' if z >= 0 & z <= 0.800001 
  6.         scalar meant``var'' = r(mean)
  7.         quietly: rdrandinf `var' z, seed(50) wl(-0.800001) wr(0.800001)
  8.         scalar diff``var'' = r(obs_stat)
  9.         scalar fpvalue``var'' = r(randpval)
 10.         scalar nleft``var'' = r(N_left)
 11.         scalar nright``var'' = r(N_right)
 12.         matrix A[`i',1] = meanc``var''
 13.         matrix A[`i',2] = meant``var''
 14.         matrix A[`i',3] = diff``var''
 15.         matrix A[`i',4] = fpvalue``var''
 16.         matrix A[`i',5] = nleft``var''
 17.         matrix A[`i',6] = nright``var'' 
 18.         local ++i
 19. }

. *
. 
. matrix list A, format(%4.3f)

A[5,6]
         c1       c2       c3       c4       c5       c6
r1    0.219    0.238    0.019    0.517  442.000  458.000
r2    0.084    0.109    0.025    0.217  442.000  458.000
r3    0.066    0.081    0.015    0.417  442.000  458.000
r4    0.081    0.074   -0.007    0.720  442.000  458.000
r5    0.054    0.044   -0.011    0.566  442.000  458.000

. putexcel C3=matrix(A)
file Results/Tables/Table A9.xlsx saved

. 
. log close
      name:  <unnamed>
       log:  /Users/luismiguelmillermoya/Dropbox/Papers/Active/CIS/Submission/PA/Final/submit/Script/BM_PA.log
  log type:  text
 closed on:  23 Nov 2020, 06:31:42
------------------------------------------------------------------------------------------------------------------------------------
